<?php

namespace App\Http\Middleware;
use Session,Config;
use Closure;

class LoginMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(Session::get('MEMBER_TOKEN'))
        {
            return $next($request);

        }else{
            echo "<script>confirm('账号过期,请从新登陆')?location.href='/' : history.back() ;</script>";
            exit();
        }
    }
}
